package cn.tedu.antcolony.passport.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * CREATE TABLE ams_admin
 * (
 *     id             bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '数据id',
 *     username   h    varchar(50)         DEFAULT NULL COMMENT '用户名',
 *     password       char(64)            DEFAULT NULL COMMENT '密码（密文）',
 *     nickname       varchar(50)         DEFAULT NULL COMMENT '昵称',
 *     avatar         varchar(255)        DEFAULT NULL COMMENT '头像URL',
 *     phone          varchar(50)         DEFAULT NULL COMMENT '手机号码',
 *     email          varchar(50)         DEFAULT NULL COMMENT '电子邮箱',
 *     description    varchar(255)        DEFAULT NULL COMMENT '简介',
 * 		dept_id        bigint(20) unsigned NOT NULL  COMMENT '部门id',
 *     enable         tinyint(3) unsigned DEFAULT 1 COMMENT '是否启用，1=启用，0=未启用',
 * 		`account_no_expired` int NULL DEFAULT 1 COMMENT '账户是否没有过期0已过期 1 正常',
 *   `credentials_no_expired` int NULL DEFAULT 1 COMMENT '密码是否没有过期0已过期 1 正常',
 *   `account_no_locked` int NULL DEFAULT 1 COMMENT '账户是否没有锁定0已锁定 1 正常',
 *     last_login_ip  varchar(50)         DEFAULT NULL COMMENT '最后登录IP地址（冗余）',
 *     login_count    int(10) unsigned    DEFAULT '0' COMMENT '累计登录次数（冗余）',
 *     gmt_last_login datetime            DEFAULT NULL COMMENT '最后登录时间（冗余）',
 *     gmt_create     datetime            DEFAULT NULL COMMENT '数据创建时间',
 *     gmt_modified   datetime            DEFAULT NULL COMMENT '数据最后修改时间',
 *     PRIMARY KEY (id)
 * ) ENGINE=InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='管理员';
 */
@Data
public class AdminAddNewParam implements Serializable {
    @ApiModelProperty(value = "用户名",required = true,example = "管理员",dataType = "string")
    @NotBlank(message = "必须填写有效用户名")
    @NotNull(message = "必须填写用户名")
    private String username;

    @ApiModelProperty(value = "密码",required = true,example = "管理员",dataType = "string")
    @NotNull(message = "必须提交密码")
    private String password;

    @ApiModelProperty(value = "昵称",required = true,example = "管理员",dataType = "string")
    @NotNull(message = "必须提交昵称")
    @NotBlank(message = "必须提交昵称")
    private String nickname;

    @ApiModelProperty(value = "头像",required = true,example = "kk",dataType = "string")
    @NotNull(message = "必须提交头像")
    @NotBlank(message = "必须提交有效头像")
    private String avatar;

    @ApiModelProperty(value = "电话号码",required = true,example = "88888888888",dataType = "string")
    @NotNull(message = "必须提交电话号码")
    @NotBlank(message = "必须提交有效电话号码")
    private String phone;

    @ApiModelProperty(value = "邮箱",example = "295588@qq.com",dataType = "string")
    @NotNull(message = "必须提交邮箱")
    @NotBlank(message = "必须提交有效邮箱")
    private String email;

    @ApiModelProperty(value = "简介",required = true,example = "康康",dataType = "string")
    @NotNull(message = "必须提交简介")
    @NotBlank(message = "必须提交有效简介")
    private String description;

    @ApiModelProperty(value = "该员工部门id",required = true,dataType = "long")
    @NotNull(message = "必须提交部门id")
    private Long deptId;

    @ApiModelProperty(value = "账号是否启用，1=启用，0=未启用'",required = true,example = "1",dataType = "int")
    @NotNull(message = "必须提交账号状态")
    @Range(min = 0,max = 1,message = "请提交有效是否启用的参数")
    private Integer enable;

    @ApiModelProperty(value = "管理员权限",required = true,example = "1",dataType = "long")
    private Long[] adminRoles;
}
